<template>
  <div>
    <van-sticky>
      <div class="dz-nav">
        <div class="goback" v-if="isBack" v-routers="{path:backUrl}">
          <img src="@/assets/images/button-back.png" alt="">
        </div>
        <div class="box-nav">
          <div class="box-center">
            <div class="left-box">
              <div class="left" :style="{background:bgk,boxShadow: boxShadow}">
                <slot name="left"></slot>
              </div>
            </div>
            <div class="box-center">
              <div class="center" :style="{background:bgk,boxShadow: boxShadow}">
                <slot name="center">My</slot>
              </div>
            </div>
            <div class="box-right-s">
              <slot name="right">
                <div class="right" :style="{background:bgk,boxShadow: boxShadow}"></div>
              </slot>
            </div>
          </div>
        </div>
      </div>
    </van-sticky>

  </div>

</template>

<script>
  export default {
    props: {
      isBack:{
        default:false
      },
      backUrl:{default: ''},
      bgk:{
        default:'#ffffff'
      },
      boxShadow:{
        default:'0px 4px 4px 0px rgba(160,58,58,0.25)'
      }
    },
    methods:{

    }

  }
</script>

<style scoped lang="scss">
.dz-nav{
  width: 100%;
  height: 50px;

  .goback{
    position: absolute;
    left: 0;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99;
    img{
      height: 24px;
      width: 24px;
      object-fit: contain;
    }
  }
  .box-nav{
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
    .box-center{
      width: 100%;
      height: 50px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      .left-box{
        width: 20%;
        height: 50px;
        align-items: center;
        display: flex;
        justify-content: right;
        .left{
          width: 29px;
          height: 8px;
          border-radius: 20px 20px 20px 20px;
        }
      }
      .box-center{
        width: 60%;
        display: flex;
        height: 50px;
        align-items: center;
        justify-content: center;
        .center{
          width: 185px;
          height: 34px;
          border-radius: 20px 20px 20px 20px;
          display: flex;
          justify-content: center;
          align-items: center;
          font-size: 18px;
        }
      }
      .box-right-s{
        width: 20%;
        display: flex;
        overflow: hidden;
        justify-content: left;
        height: 50px;
        align-items: center;
        .right{
          width: 29px;
          min-height: 8px;
          border-radius: 20px 20px 20px 20px;
        }
      }
    }
  }
}
</style>